import Bmob from "hydrogen-js-sdk";
class BombUtil {

    init = ()=>{
        Bmob.initialize("498d664c130a3076ce0d27e26e100671", "ef12e0572dfaeb366cc6ff526bedd3f5");
    };

    findAllDatas = async(types)=>{
        const query = Bmob.Query("courseInfo");
        let newDatas = Object.assign([],types);
        for(let i=0;i<newDatas.length;i++){
            try{
                 query.equalTo('courseType','==',newDatas[i].courseType);
                let res = await query.find();
                newDatas[i].list = res;
                console.log(newDatas[i]);
            }catch (e) {
                console.log('error',e)
            }
        }
        return newDatas;
    }
}
export const BombUtils = new BombUtil
